{extend name="pub/base" /}
{block name="title"}
<title>vip码生成设置</title>
{/block}
{block name="body"}
<div class="Hui-admin-article">
    <nav class="breadcrumb" style="background-color:#fff;padding: 0 24px">
        首页
        <span class="c-gray en">/</span>
        卡密生成设置
        <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
           href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
    </nav>
    <div class="Hui-article">
        <article class="clearfix pd-20">
            <form action="{:url('kamiconfig')}" method="post" class="form form-horizontal">
                <div class="row clearfix">
                    <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>vip码天数：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" class="input-text" value="{$vipcode_day}" name="vipcode_day">
                    </div>
                </div>

                <div class="row clearfix">
                    <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>vip码生成个数：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" class="input-text" value="{$vipcode_num}" name="vipcode_num">
                    </div>
                </div>

                <div class="row clearfix">
                    <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>充值卡面额：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" class="input-text" value="{$chargecode_money}" name="chargecode_money">
                    </div>
                </div>

                <div class="row clearfix">
                    <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>充值码生成个数：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" class="input-text" value="{$chargecode_num}" name="chargecode_num">
                    </div>
                </div>


                <div class="row clearfix">
                    <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                        <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                    </div>
                </div>
            </form>
        </article>
    </div>
</div>
<script>
    $(function(){
        /* 表单验证，提交 */
        $("form").validate({
            rules: {
                vipcode_day: {
                    required:true,
                    digits: true
                },
                vipcode_num: {
                    required:true,
                    digits: true
                },
                chargecode_money: {
                    required:true,
                    digits: true
                },
                chargecode_num: {
                    required:true,
                    digits: true
                }
            },
            messages: {
                vipcode_day: {
                    digits:"必须是整数"
                },
                vipcode_num: {
                    digits:"必须是整数"
                },
                chargecode_money: {
                    digits: "必须是整数"
                },
                chargecode_num: {
                    digits: "必须是整数"
                }
            },
            onkeyup: false,
            focusCleanup: false,
            submitHandler: function(form) {
                $.ajax({
                    url:"{:url('kamiconfig')}",
                    type:'post',
                    data:$('form').serialize(),
                    success(res) {
                        subResHandle(res)
                    }
                })
            }
        });
    });
</script>
{/block}